<!doctype html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en">
<!--<![endif]-->
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="${base}/assets/amazeui/css/amazeui.min.css"/>
    <link rel="stylesheet" href="${base}/assets/amazeui/css/admin.css"/>
    <link rel="stylesheet" href="${base}/assets/amazeui/amazeui-ext.css"/>

    <script src="${base}/assets/amazeui/js/jquery.min.js"></script>
    <script src="${base}/assets/amazeui/js/amazeui.min.js"></script>
<script type="text/javascript">
    function insertConsult(pid, mid) {
        var content = $("#goods_question_contens_box").val();
        $.post("insertConsult.htm", {
            productId: pid, content: content
        }, function (data) {
            if (data == 'false') {
                parent.alert('请先登录！');
                var loginForm = getLoginForm();
                loginForm.submit();
            } else if (data == 'sameUsually') {
                parent.alert('请在30秒后发表');
            }
            else if (data == 'success') {
                parent.alert('成功');
            }else{
                parent.alert('服务端错误');
            }
        },"json");
    }

    function getLoginForm() {
        return document.getElementById("loginForm");
    }
    function getTableForm() {
        return document.getElementById("tableForm");
    }

</script>
<style>

</style>
</head>
<body>

<div class="am-container">
    [#list pagination.list as c]
    <ul>
        <li><strong>${c.member.username!}</strong>&nbsp;&nbsp;<span>[${c.time}]</span></li>
        <li class="pl_txt">${c.consult!}</li>
        [#if c.adminReplay??]
        <li>
            <dl class="re_txt">
                <dd><span>客服：</span>${c.adminReplay}
                    <div></div>
                </dd>
            </dl>
        </li>
        [#else]
        <li>
            <dl class="re_txt">
                <div class="clear"></div>
            </dl>
        </li>
        [/#if]
    </ul>
    [/#list]
    [@pagination_style style='8'/]
    <div class="clear"></div>
    <form class="am-form" id="loginForm" action="${base!}/login.htm" method="get" target="_top"></form>
    <form class="am-form"  id="tableForm" action="consultProduct.htm" method="post">
        <input type="hidden" value="${product.id!}" name="productId">
    </form>
    <ul>
        <li>你有什么购买问题及产品意见？</li>
        <li>
            <textarea rows="6" cols="50" id="goods_question_contens_box" name="content" class="wenti_input"></textarea>
        </li>
    </ul>
    <input type="button" value="提交" onclick="insertConsult('${product.id}');"/>
</div>
</body>
</html>
